minecraft java
In Minecraft, command blocks can't be crafted or found.
Mojang
  • You can get a command block in your Minecraft world using a special chat command.
  • You'll need to have both Cheats and Creative Mode enabled in your Minecraft world to get a command block.
  • Once you summon your command block, you can use codes to customize how it works.
  • Visit Insider's Tech Reference library for more stories.

Minecraft is a surprisingly complex game. On the surface, it just looks like a big Lego simulator – but dig deep enough, and you can build sprawling rail systems, paint pictures, and even program in-game computers.

Command blocks are one of those complex features. Powered by redstone, command blocks let you automate the world, control players, set server rules, and more.

But unlike other items, you can't find command blocks out in the world, or in the full list of items. Instead, you'll need to spawn it into the game using cheats.

Here's how to get a command block in Minecraft, using either Java or Bedrock edition.

How to get a command block in Minecraft

The method to get a command block is pretty much the same in both Java and Bedrock.

1. Firstly, make sure that your world or Realms server has cheats turned on, and that you're playing in Creative Mode.

Minecraft's world generation screen, which allows the user to customize the world they're making. The gamemode and "cheats" options are highlighted.
Turn on both Creative Mode and cheats.
Mojang; William Antonelli/Insider

2. Open the chat box by pressing T on your keyboard, or the right d-pad button on a controller.

3. In the chat box, type:

/give [your username] minecraft:command_block

In place of "[your username]," insert your Minecraft username.

A Minecraft screenshot where the player has entered a command into the chat box.
If you want to give the command block to another player on your server, you can insert their name instead.
Mojang; William Antonelli/Insider

4. The command block will appear in your inventory. While it's in your hand, you can place it down on any solid surface.

A command block in Minecraft.
You'll be given an infinite amount of command blocks.
Mojang; William Antonelli/Insider

Using the command block

Once you've placed your command block, you can set the block up with codes so it performs automatic tasks. These tasks include killing enemies as soon as they spawn, giving players items, and more.

1. Select the command block that you placed.

2. In the menu that opens, you'll have a few options. Use the first option to choose how often the command block should run: Impulse will run the command once and then stop, Repeat/Current will run the command indefinitely, and Chain will require any connected command block to run before it does.

3. The second option, Conditional or Unconditional, determines whether a connected command block needs to run successfully for this block to run.

4. The third option lets you choose whether the command block can run on its own - Always Active - or Needs Redstone to power it.

5. Finally, type your command into the text field. For example, if you want to kill every creeper in the area, you'll type:

/kill @e[type=minecraft:creeper]

You can find a list of common codes here.

The command block settings menu in Minecraft.
Set up your command block with an action and conditions.
Mojang; William Antonelli/Insider

6. When you're ready for the command block to start running, click Done.

How to install Minecraft Forge and gain access to thousands of new Minecraft modsHow to get a cape in Minecraft, even without modsHow to install OptiFine to massively enhance 'Minecraft's' graphics and add new featuresHow to make an End Portal in 'Minecraft,' and use it to find the game's final boss

Read the original article on Business Insider